package com.ruoyi.labsafety.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.labsafety.mapper.LabSafetyCheckRelIndexItemMapper;
import com.ruoyi.labsafety.domain.LabSafetyCheckRelIndexItem;
import com.ruoyi.labsafety.service.ILabSafetyCheckRelIndexItemService;

/**
 * 安检检查指标项Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-31
 */
@Service
public class LabSafetyCheckRelIndexItemServiceImpl implements ILabSafetyCheckRelIndexItemService 
{
    @Autowired
    private LabSafetyCheckRelIndexItemMapper labSafetyCheckRelIndexItemMapper;

    /**
     * 查询安检检查指标项
     * 
     * @param id 安检检查指标项ID
     * @return 安检检查指标项
     */
    @Override
    public LabSafetyCheckRelIndexItem selectLabSafetyCheckRelIndexItemById(Long id)
    {
        return labSafetyCheckRelIndexItemMapper.selectLabSafetyCheckRelIndexItemById(id);
    }

    /**
     * 查询安检检查指标项列表
     * 
     * @param labSafetyCheckRelIndexItem 安检检查指标项
     * @return 安检检查指标项
     */
    @Override
    public List<LabSafetyCheckRelIndexItem> selectLabSafetyCheckRelIndexItemList(LabSafetyCheckRelIndexItem labSafetyCheckRelIndexItem)
    {
        return labSafetyCheckRelIndexItemMapper.selectLabSafetyCheckRelIndexItemList(labSafetyCheckRelIndexItem);
    }

    /**
     * 新增安检检查指标项
     * 
     * @param labSafetyCheckRelIndexItem 安检检查指标项
     * @return 结果
     */
    @Override
    public int insertLabSafetyCheckRelIndexItem(LabSafetyCheckRelIndexItem labSafetyCheckRelIndexItem)
    {
        return labSafetyCheckRelIndexItemMapper.insertLabSafetyCheckRelIndexItem(labSafetyCheckRelIndexItem);
    }

    /**
     * 修改安检检查指标项
     * 
     * @param labSafetyCheckRelIndexItem 安检检查指标项
     * @return 结果
     */
    @Override
    public int updateLabSafetyCheckRelIndexItem(LabSafetyCheckRelIndexItem labSafetyCheckRelIndexItem)
    {
        return labSafetyCheckRelIndexItemMapper.updateLabSafetyCheckRelIndexItem(labSafetyCheckRelIndexItem);
    }

    /**
     * 批量删除安检检查指标项
     * 
     * @param ids 需要删除的安检检查指标项ID
     * @return 结果
     */
    @Override
    public int deleteLabSafetyCheckRelIndexItemByIds(Long[] ids)
    {
        return labSafetyCheckRelIndexItemMapper.deleteLabSafetyCheckRelIndexItemByIds(ids);
    }

    /**
     * 删除安检检查指标项信息
     * 
     * @param id 安检检查指标项ID
     * @return 结果
     */
    @Override
    public int deleteLabSafetyCheckRelIndexItemById(Long id)
    {
        return labSafetyCheckRelIndexItemMapper.deleteLabSafetyCheckRelIndexItemById(id);
    }

    @Override
    public int deleteLabSafetyCheckRelIndexItemByInstanceId(Long instanceId) {
        return labSafetyCheckRelIndexItemMapper.deleteLabSafetyCheckRelIndexItemByInstanceId(instanceId);
    }

    @Override
    public int insertLabSafetyCheckRelIndexItemByIndexId(Long instanceId, Long[] indexIds) {
        return labSafetyCheckRelIndexItemMapper.insertLabSafetyCheckRelIndexItemByIndexId(instanceId, indexIds);
    }

    @Override
    public int updateLabSafetyCheckRelIndexItemStatus(
        LabSafetyCheckRelIndexItem labSafetyCheckRelIndexItem) {

        return labSafetyCheckRelIndexItemMapper.updateLabSafetyCheckRelIndexItemStatus(
            labSafetyCheckRelIndexItem.getId(), labSafetyCheckRelIndexItem.getStatus());
    }
}
